package com.community.charge.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.community.common.annotation.Excel;
import com.community.common.core.domain.BaseEntity;

/**
 * 抄表账单对象 meter_reading_records
 * 
 * @author ruoyi
 * @date 2025-10-29
 */
@Data
public class MeterReadingRecords extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 记录ID */
    @Excel(name = "记录ID")
    private Long id;

    /** 社区ID */
    @Excel(name = "社区ID")
    private Long communityId;

    /** 楼宇ID */
    @Excel(name = "楼宇ID")
    private Long buildingId;

    /** 房间ID */
    @Excel(name = "房间ID")
    private Long roomId;

    /** 收费项目ID */
    @Excel(name = "收费项目ID")
    private Long chargeItemId;

    /** 缴费周期（存储为每月1号，例如2025-10-01） */
    @JsonFormat(pattern = "yyyy-MM")
    private Date paymentCycle;

    /** 上期表底 */
    private BigDecimal lastReading;

    /** 本期表底 */
    private BigDecimal currentReading;

    /** 用量（自动计算，current_reading - last_reading） */

    private BigDecimal consumption;

    /** 费用（自动计算，consumption * unit_price） */
    @Excel(name = "费用", readConverterExp = "自=动计算，consumption,*=,u=nit_price")
    private BigDecimal amount;

    /** 单价 */
    private BigDecimal unitPrice;

    /** 抄表时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "抄表时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date readingTime;

    /** 操作员ID */
    private Long operatorId;

    /** 创建时间 */
    private Date createdAt;

    //支付状态: 0(已支付)  1(未支付)
    private Integer paymentStatus;

    //关联字段
    private String communityName;
    private String buildingName;
    private String roomNo;
    private String chargeItemName;

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    public String getBuildingName() {
        return buildingName;
    }

    public void setBuildingName(String buildingName) {
        this.buildingName = buildingName;
    }

    public String getRoomName() {
        return roomNo;
    }

    public void setRoomName(String roomNo) {
        this.roomNo = roomNo;
    }

    public String getChargeItemName() {
        return chargeItemName;
    }

    public void setChargeItemName(String chargeItemName) {
        this.chargeItemName = chargeItemName;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setCommunityId(Long communityId)
    {
        this.communityId = communityId;
    }

    public Long getCommunityId()
    {
        return communityId;
    }

    public void setBuildingId(Long buildingId)
    {
        this.buildingId = buildingId;
    }

    public Long getBuildingId()
    {
        return buildingId;
    }

    public void setRoomId(Long roomId)
    {
        this.roomId = roomId;
    }

    public Long getRoomId()
    {
        return roomId;
    }

    public void setChargeItemId(Long chargeItemId)
    {
        this.chargeItemId = chargeItemId;
    }

    public Long getChargeItemId()
    {
        return chargeItemId;
    }

    public void setPaymentCycle(Date paymentCycle)
    {
        this.paymentCycle = paymentCycle;
    }

    public Date getPaymentCycle()
    {
        return paymentCycle;
    }

    public void setLastReading(BigDecimal lastReading)
    {
        this.lastReading = lastReading;
    }

    public BigDecimal getLastReading()
    {
        return lastReading;
    }

    public void setCurrentReading(BigDecimal currentReading)
    {
        this.currentReading = currentReading;
    }

    public BigDecimal getCurrentReading()
    {
        return currentReading;
    }

    public void setConsumption(BigDecimal consumption)
    {
        this.consumption = consumption;
    }

    public BigDecimal getConsumption()
    {
        return consumption;
    }

    public void setAmount(BigDecimal amount)
    {
        this.amount = amount;
    }

    public BigDecimal getAmount()
    {
        return amount;
    }

    public void setUnitPrice(BigDecimal unitPrice)
    {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice()
    {
        return unitPrice;
    }

    public void setReadingTime(Date readingTime)
    {
        this.readingTime = readingTime;
    }

    public Date getReadingTime()
    {
        return readingTime;
    }

    public void setOperatorId(Long operatorId)
    {
        this.operatorId = operatorId;
    }

    public Long getOperatorId()
    {
        return operatorId;
    }

    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("communityId", getCommunityId())
            .append("buildingId", getBuildingId())
            .append("roomId", getRoomId())
            .append("chargeItemId", getChargeItemId())
            .append("paymentCycle", getPaymentCycle())
            .append("lastReading", getLastReading())
            .append("currentReading", getCurrentReading())
            .append("consumption", getConsumption())
            .append("amount", getAmount())
            .append("unitPrice", getUnitPrice())
            .append("readingTime", getReadingTime())
            .append("operatorId", getOperatorId())
            .append("remark", getRemark())
            .append("createdAt", getCreatedAt())
            .toString();
    }
}

